package assets_withdraw

import (
	"context"

	"gitee.com/liuxuezhan/ar-platform/admin-api/internal/svc"
	"gitee.com/liuxuezhan/ar-platform/admin-api/internal/types"
	"gitee.com/liuxuezhan/ar-platform/rpc-client/assetsClient/rpc"
	"github.com/zeromicro/go-zero/core/logx"
)

type BankAgentDelLogic struct {
	logx.Logger
	ctx    context.Context
	svcCtx *svc.ServiceContext
}

// b端提现管理--代付三方银行--删除
func NewBankAgentDelLogic(ctx context.Context, svcCtx *svc.ServiceContext) *BankAgentDelLogic {
	return &BankAgentDelLogic{
		Logger: logx.WithContext(ctx),
		ctx:    ctx,
		svcCtx: svcCtx,
	}
}

func (l *BankAgentDelLogic) BankAgentDel(req *types.BankAgentDelReq) (resp *types.BankAgentDelRes, err error) {
	// todo: add your logic here and delete this line
	rpc_req := &rpc.BankAgentDelRequest{
		Id: req.Id,
	}

	// 发送请求
	_, err = l.svcCtx.AssetsRpc.TenantChannel.BankAgentDel(l.ctx, rpc_req)
	if err != nil {
		logx.Errorf("BankAgentDel error: %v", err)
		return nil, err
	}

	// 处理请求返回的结果
	// 解析、组合数据
	resp = &types.BankAgentDelRes{}

	return
}
